package JZOffer;

// 左旋转字符串
public class JzOffer58 {
    public String reverseLeftWords(String s, int n) {
        StringBuilder builder = new StringBuilder();

        builder.append(s, n, s.length());
        builder.append(s, 0, n);

        return builder.toString();
    }



    public String reverseLeftWords1(String s, int n) {
        StringBuilder builder = new StringBuilder();

        for (int i = n; i < s.length(); i++) {
            builder.append(s.charAt(i));
        }

        for (int i = 0; i < n; i++) {
            builder.append(s.charAt(i));
        }

        return builder.toString();
    }
}
